package com.szrt.day20170523.ch01;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class OracleDemo {
	
	
	public static void main(String[] args) throws Exception {
		
		
		
		//1 加载对应的驱动
		Class.forName("oracle.jdbc.OracleDriver");
		
		//2 连接数据库
		
		String url="jdbc:oracle:thin:@127.0.0.1:1521:xe";
		String user="scott";
		String password="123456";
		Connection connection = DriverManager.getConnection(url, user, password);
		
		Statement sm = connection.createStatement();
		
		String sql ="insert into employee values(1004,33,12000.56,'xq')";
		int count = sm.executeUpdate(sql);
		
		System.out.println(count);
		
		System.out.println("插入成功....");
		
		sm.close();
		connection.close();
		
		
		
		
		
	}

}
